package com.didd.core.common.utils;

import org.apache.commons.lang3.StringUtils;

/**
 * @author diddd
 * @Classname PasswordRandomUtil
 * @Description 密码加密工具类
 * @Date 2020/11/7/0007 17:37
 */
public class PasswordMd5EncryptUtil {
    // public static String encryptPassword(String password){
    //     String s = RandomUtil.randomString(10);
    //     return MD5.encrypt(password+s);
    // }

    public static String encryptPasswordWithSalt(String password, String salt) {
        if (StringUtils.isBlank(salt)) {
            salt = "";
        }
        return MD5.encrypt(password + salt);
    }
}
